Data storage device and mode-detection method thereof

ABSTRACT

A data storage device including a flash memory and a controller. The controller enables the flash memory to transmit a predetermined parameter stored in the flash memory according to a first predetermined trigger edge of a clock signal and reads the predetermined parameter transmitted by the flash memory according to the first predetermined trigger edge of the clock signal to obtain a first reference parameter in an asynchronous mode. The controller enables the flash memory to switch to a synchronous mode and transmit the predetermined parameter and reads the predetermined parameter transmitted by the flash memory according to the first predetermined trigger edge of the clock signal to obtain a second reference parameter in a detection mode.

CROSS REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. application Ser. No.14/504,014, filed on Oct. 1, 2014, which claims priority to TaiwanPatent Application No. 102145064 filed on Dec. 9, 2013, the entirety ofwhich are incorporated by reference herein.

BACKGROUND OF THE INVENTION

Field of the Invention

The present invention relates to a mode-detection method applied to amemory device, and in particular to a synchronous mode-detection method.

Description of the Related Art

Flash memory is considered a non-volatile data storage device, usingelectrical methods to erase and program itself. Taking NAND Flash as anexample, it is often used in memory cards, USB flash devices, solidstate devices, emmc, and other uses.

On the market, there are many types of access methods. However, some ofthe manufacturers do not inform retailers which modes are supported bythe flash memory, such that the retailers cannot maximize theperformance of the flash memory.

BRIEF SUMMARY OF THE INVENTION

A detailed description is given in the following embodiments withreference to the accompanying drawings.

The present invention provides a data storage device capable ofoperating in an asynchronous mode and a detection mode. The data storagedevice includes a flash memory and a controller. The flash memory isarranged to store a predetermined parameter. In the asynchronous mode,the controller is arranged to enable the flash memory to transmit thepredetermined parameter according a first predetermined trigger edge ofa clock signal and read the predetermined parameter transmitted by theflash memory according to the first predetermined trigger edge of theclock signal to obtain a first reference parameter. In the detectionmode, the flash memory is further arranged to enable the flash memory toswitch to a synchronous mode and transmit the predetermined parameterand read the predetermined parameter transmitted by the flash memoryaccording to the first predetermined trigger edge of the clock signal toobtain a second reference parameter. Moreover, the controller is furtherarranged to compare the first reference parameter with the secondreference parameter for determining whether the flash memory supportsthe synchronous mode.

The present invention further provides a mode-detection method appliedto a data storage device capable of operating in an asynchronous modeand a detection mode, including: enabling a flash memory of the datastorage device to transmit a predetermined parameter stored in the flashmemory according a first predetermined trigger edge of a clock signal inthe asynchronous mode; reading the predetermined parameter transmittedby the flash memory according to the first predetermined trigger edge ofthe clock signal to obtain a first reference parameter in theasynchronous mode; enabling the flash memory to switch to a synchronousmode and transmit the predetermined parameter in the detection mode;reading the predetermined parameter transmitted by the flash memoryaccording to the first predetermined trigger edge of the clock signal toobtain a second reference parameter in the detection mode; and comparingthe first reference parameter with the second reference parameter fordetermining whether the flash memory supports the synchronous mode.

BRIEF DESCRIPTION OF THE DRAWINGS

The present invention can be more fully understood by reading thesubsequent detailed description and examples with references made to theaccompanying drawings, wherein:

FIG. 1 is a schematic diagram illustrating an embodiment of a datastorage device of the present disclosure.

FIG. 2 is a signal diagram illustrating an embodiment of signals in anasynchronous mode of the present disclosure.

FIG. 3 is a signal diagram illustrating another embodiment of signals inthe asynchronous mode of the present disclosure.

FIG. 4 is a signal diagram illustrating an embodiment of signals in adetection mode of the present disclosure.

FIG. 5 is a signal diagram illustrating another embodiment of signals inthe detection mode of the present disclosure.

FIG. 6 is a signal diagram illustrating another embodiment of signals inthe detection mode of the present disclosure.

FIG. 7 is a signal diagram illustrating another embodiment of signals inthe detection mode of the present disclosure.

FIG. 8 is a signal diagram illustrating an embodiment of signals in asynchronous mode of the present disclosure.

FIG. 9 is a signal diagram illustrating another embodiment of signals inthe synchronous mode of the present disclosure.

FIG. 10 is a flowchart of mode-detection method according to anotherembodiment of the present disclosure.

DETAILED DESCRIPTION OF THE INVENTION

The following description is of the best-contemplated mode of carryingout the invention. This description is made for the purpose ofillustrating the general principles of the invention and should not betaken in a limiting sense. The scope of the invention is best determinedby reference to the appended claims.

FIG. 1 is a schematic diagram illustrating an embodiment of a datastorage device of the present disclosure. The data storage device 100includes a controller 160 and a flash memory 180. It should be notedthat the data storage device 100 is capable of operating in anasynchronous mode (Asynchronous Mode/SDR Mode) and a detection mode. Thecontroller 160 is arranged to transmit a plurality of enable signals tothe flash memory 180. The enable signals may include the enable clocksignal CE, the read-enable clock signal RE#, and the write-enable clocksignal WE#, but it is not limited thereto. Moreover, a data line DATA isbetween the controller 160 and the flash memory 180. The data line DATAis arranged to transmit data. The controller 160 includes a computingunit 162 and a non-volatile memory (such as a read only memory ROM) 164.The program code and data stored in the non-volatile memory 164 mayconstitute firmware, and be performed by the computing unit 162, suchthat the controller 160 may control the flash memory 180 by thefirmware. It should be noted that, in the present invention, the flashmemory 180 is arranged to store a predetermined parameter. For example,the predetermined parameter is able to be saved to the flash memorywhile the flash memory is in production and arranged to determine thetype of the flash memory 180, but it is not limited thereto.

The firmware disclosed by the present invention is arranged to enablethe controller 160 to enable the flash memory 180 to operate in themode-detection method for detecting whether the flash memory 180supports a synchronous mode. The synchronous mode may be the ONFI DDRMode or the ONFI Toggle Mode defined by the producer, but it is notlimited thereto. For example, in the asynchronous mode, the controller160 is arranged to enable the flash memory 180 to transmit thepredetermined parameter to the controller 160 according to a firstpredetermined trigger edge of a clock signal, and read the predeterminedparameter according to the first predetermined trigger edge of the clocksignal to obtain a first reference parameter. Next, in the detectionmode, the controller 160 enables the flash memory 180 to switch to thesynchronous mode and transmit the predetermined parameter, and read thefirst predetermined trigger edge transmitted by the flash memory 180according to the first predetermined trigger edge of the clock signal toobtain a second reference parameter. It should be noted that thecontroller 160 may read the predetermined parameter according to a readcommand in the asynchronous mode and the detection mode. For example,the read command may be a READ Command or a READ PARAMETER Command.Finally, the controller 160 is arranged to compare the first referenceparameter with the second reference parameter for determining whetherthe flash memory 180 supports the synchronous mode. It should be notedthat, if the flash memory 180 supports the synchronous mode, the flashmemory 180 transmits the predetermined parameter to the controller 160according to a second predetermined trigger edge of the clock signalafter the controller 160 enables the flash memory 180 to switch to thesynchronous mode, wherein the first predetermined trigger edge and thesecond predetermined trigger edge is different. If the flash memory 180does not support the synchronous mode, the flash memory 180 transmitsthe predetermined parameter to the controller 160 according to the firstpredetermined trigger edge of the clock signal after the controller 160enables the flash memory 180 to switch to the synchronous mode.Therefore, when the first reference parameter and the second referenceparameter are equal, the controller 160 determines that the flash memory180 does not support the synchronous mode. When the first referenceparameter is different from the second reference parameter, thecontroller 160 determines that the flash memory 180 supports thesynchronous mode. In one embodiment, the controller 160 may produce adetermination signal according to the result and provide thedetermination signal to a host (not shown), such that the host mayperform the corresponding operation according to the determinationsignal. For example, the host may display the result on an output deviceaccording to the determination signal. The output device may be adisplay device, a speaker or a light, but it is not limited thereto.

It should be noted that, when the flash memory 180 supports thesynchronous mode and the data storage device 100 is in the synchronousmode, the controller 160 enables the flash memory 180 to transmit andwrite data according to the frequency of the second predeterminedtrigger edge of the clock signal. The controller 160 then reads the datatransmitted by the flash memory 180 and writes data into the flashmemory 180 according to the second predetermined trigger edge of theclock signal. Moreover, in one embodiment, the first predeterminedtrigger edge is the positive edge of the clock signal, and the secondpredetermined trigger edge includes both the positive edge and thenegative edge of the clock signal. In another embodiment, the firstpredetermined trigger edge is the negative edge of the clock signal, andthe second predetermined trigger edge includes the positive edge and thenegative edge of the clock signal.

Namely, in one embodiment, data is arranged to be read from and writteninto the flash memory 180 bit by bit with the rate of the positive edgeor the negative edge of the clock signal in the asynchronous mode, anddata is arranged to be read from and written into the flash memory 180bit by bit with the rate of the positive edge and the negative edge inthe synchronous mode. Namely, the rate of reading and writing data inthe synchronous mode is twice that of the asynchronous mode. Moreover,in the detection mode, the controller 160 reads the data received fromthe flash memory 180 at the rate of the asynchronous mode after thecontroller 160 enables the flash memory 180 to switch to the synchronousmode.

In one embodiment, the synchronous mode is a ONFI Toggle mode. Inanother embodiment, the synchronous mode is a ONFI DDR mode. It shouldbe noted that, when the synchronous mode is the ONFI Toggle, the clocksignal is a read-enable clock signal RE# arranged to be transmitted tothe flash memory 180 from the controller 160. When the synchronous modeis the ONFI DDR mode, the clock signal is a write-enable clock signalWE# arranged to be transmitted to the flash memory 180 from thecontroller 160, but it is not limited thereto.

FIG. 2 is a signal diagram illustrating an embodiment of signals in anasynchronous mode of the present disclosure. In this embodiment, theclock signal is the read-enable clock signal RE# and the firstpredetermined trigger edge is the positive edge of the read-enable clocksignal RE#. In the asynchronous mode, the controller 160 is arranged toenable the flash memory 180 to transmit the predetermined parameterD₀-D_(n) according to the positive edge of the read-enable clock signalRE# through the data line DATA to the controller 160. Next, thecontroller 160 reads the predetermined parameter D₀-D_(n) according tothe positive edge of the read-enable clock signal RE# and takes the readpredetermined parameter D₀-D_(n) as the first reference parameter. Itshould be noted that, in one embodiment of the present invention, in theasynchronous mode, the controller 160 is arranged to read at least twodata sectors D₀-D_(n) of the predetermined parameter transmitted by theflash memory 180 according to the positive edge of the read-enable clocksignal RE#, and take the at least two data sectors D₀-D_(n) as the firstreference parameter. For example, the controller 160 may read four datasectors D₀, D₁, D₂ and D₃ of the predetermined parameter D₀-D_(n)transmitted by the flash memory 180 according to the positive edge ofthe read-enable clock signal RE#, and take the four data sectors D₀, D₁,D₂ and D₃ as the first reference parameter, but it is not limitedthereto.

FIG. 3 is a signal diagram illustrating another embodiment of signals inthe asynchronous mode of the present disclosure. In this embodiment, theclock signal is the read-enable clock signal RE#, and the firstpredetermined trigger edge is the negative edge of the read-enable clocksignal RE#. In the asynchronous mode, the controller 160 is arranged toenable the flash memory 180 to transmit the predetermined parameterD₀-D_(n) according to the negative edge of the read-enable clock signalRE# through the data line DATA to the controller 160. Next, in theasynchronous mode, the controller 160 reads the predetermined parameterD₀-D_(n) transmitted by the flash memory 180 according to the negativeedge of the read-enable clock signal RE# to obtain a first referenceparameter. It should be noted that, in one embodiment of the presentinvention, in the asynchronous mode, the controller 160 reads thepredetermined parameter D₀-D_(n) transmitted with the negative edge ofthe read-enable clock signal RE# by the flash memory 180 according tothe negative edge of the read-enable clock signal RE#, and take the readpredetermined parameter D₀-D_(n) as the first reference parameter. Forexample, the controller 160 may read four data sectors D₀, D₁, D₂ and D₃of the predetermined parameter transmitted with the negative edge of theread-enable clock signal RE# by the flash memory 180, and take the fourdata sectors D₀, D₁, D₂ and D₃ as the first reference parameter, but itis not limited thereto.

Next, as shown in FIG. 4, FIG. 4 is a signal diagram illustrating anembodiment of signals in a detection mode of the present disclosure. Inthis embodiment, the synchronous mode is the ONFI Toggle mode, the clocksignal is the read-enable clock signal RE#, the first predeterminedtrigger edge is the positive edge of the read-enable clock signal RE#,the second predetermined trigger edge includes both the positive edgeand the negative edge of the read-enable clock signal RE#, and the flashmemory 180 supports the synchronous mode. In the detection mode, thecontroller 160 enables the flash memory 180 to be switched to thesynchronous mode and to transmit the predetermined parameter D₀-D_(n) tothe controller 160. It should be noted that, in this embodiment, theflash memory 180 supports the synchronous mode, such that the flashmemory 180 can transmit the predetermined parameter D₀-D_(n) accordingto both the positive edge and the negative edge of the read-enable clocksignal RE# to the controller 160 after the controller 160 enables theflash memory 180 to switch to the synchronous mode. Moreover, thecontroller 160 reads the predetermined parameter according to thepositive edge of the read-enable clock signal RE# to obtain a secondreference parameter. It should be noted that, in one embodiment, in thedetection mode, the controller 160 reads at least two data sectors ofthe predetermined parameter D₀-D_(n) transmitted with both the positiveedge and the negative edge of the read-enable clock signal RE# by theflash memory 180 according to the positive edge of the read-enable clocksignal RE#, and takes the read least two data sectors as the secondreference parameter. Namely, in the detection mode, the controller 160reads the predetermined parameter D₀-D_(n) transmitted by the flashmemory 180 at the rate of the asynchronous mode after the controller 160enables the flash memory 180 to switch to the synchronous mode. Forexample, the controller 160 reads four data sectors D, D₂, D₄ and D₆ ofthe predetermined parameter transmitted with both the positive edge andthe negative edge of the read-enable clock signal RE# by the flashmemory 180 according to the positive edge of the read-enable clocksignal RE#, and take the four data sectors D₀, D₂, D₄ and D₆ as thesecond reference parameter, but it is not limited thereto. It should benoted that, in one embodiment of the present invention, the flash memory180 supports the synchronous mode, such that the first referenceparameter constituted by D₀, D₁, D₂ and D₃ and read by the controller160 in the asynchronous mode is different from the second referenceparameter constituted by D₀, D₂, D₄ and D₆ and read by the controller160 in the detection mode.

FIG. 5 is a signal diagram illustrating another embodiment of signals inthe detection mode of the present disclosure. In this embodiment, thesynchronous mode is the ONFI Toggle mode, the clock signal is theread-enable clock signal RE#, the first predetermined trigger edge isthe negative edge of the read-enable clock signal RE#, the secondpredetermined trigger edge includes both the positive edge and thenegative edge of the read-enable clock signal RE#, and the flash memory180 supports the synchronous mode. In the detection mode, the controller160 enables the flash memory 180 to switch to the synchronous mode andtransmit the predetermined parameter D₀-D_(n) to the controller 160. Itshould be noted that, in this embodiment, the flash memory 180 supportsthe synchronous mode, such that the flash memory 180 can transmit thepredetermined parameter D₀-D_(n) according to both the positive edge andthe negative edge of the read-enable clock signal RE# to the controller160 through the data line DATA after the controller 160 enables theflash memory 180 to switch to the synchronous mode. Moreover, thecontroller 160 reads the predetermined parameter according to thenegative edge of the read-enable clock signal RE# to obtain a secondreference parameter. It should be noted that, in one embodiment of thepresent invention, the controller 160 is arranged to read at least twodata sectors of the predetermined parameter D₀-D_(n) transmitted withboth the positive edge and the negative edge of the read-enable clocksignal RE# by the flash memory 180 according to the negative edge of theread-enable clock signal RE# in the detection mode, and take the read atleast two data sectors as the second reference parameter. Namely, in thedetection mode, the controller 160 reads the predetermined parameterD₀-D_(n) transmitted by the flash memory 180 at the rate of theasynchronous mode after the controller 160 enables the flash memory 180to switch to the synchronous mode. For example, the controller 160 mayread the data sectors D₁, D₃, D₅ and D₇ of the predetermined parametertransmitted with the negative edge and the positive edge of theread-enable clock signal RE# by the flash memory 180 according to thenegative edge of the read-enable clock signal RE#, and take the datasectors D₁, D₃, D₅ and D₇ of the predetermined parameter as the secondreference parameter, but it is not limited thereto. It should be notedthat, in one embodiment of the present invention, the flash memory 180supports the synchronous mode, such that the first reference parameterconstituted by D₀, D₁, D₂ and D₃ and read by the controller 160 in theasynchronous mode is different from the second reference parameterconstituted by D₁, D₃, D₅ and D₇ and read by the controller 160 in thedetection mode.

FIG. 6 is a signal diagram illustrating another embodiment of signals inthe detection mode of the present disclosure. In this embodiment, thesynchronous mode is the ONFI DDR mode, the clock signal is thewrite-enable clock signal WE#, the first predetermined trigger edge isthe positive edge of the write-enable clock signal WE#, the secondpredetermined trigger edge includes both the positive edge and thenegative edge of the write-enable clock signal WE#, and the flash memory180 supports the synchronous mode. In the detection mode, the controller160 enables the flash memory 180 to switch to the synchronous mode andtransmit the predetermined parameter D₀-D_(n) to the controller. Itshould be noted that, in this embodiment, the flash memory 180 supportsthe synchronous mode, such that the flash memory 180 can transmit thepredetermined parameter D₀-D_(n) according to both the positive edge andthe negative edge of the write-enable clock signal WE# to the controller160 through the data line DATA after the controller 160 enables theflash memory 180 to switch to the synchronous mode. Moreover, thecontroller 160 reads the predetermined parameter according to thepositive edge of the write-enable clock signal WE# to obtain a secondreference parameter. It should be noted that, in one embodiment, in thedetection mode, the controller 160 reads the at least two data sectorsof the predetermined parameter D₀-D_(n) transmitted with both thepositive edge and the negative edge of the write-enable clock signal WE#by the flash memory 180 according to the positive edge of thewrite-enable clock signal WE#, and take the read least two data sectorsas the second reference parameter. Namely, in the detection mode, thecontroller 160 reads the predetermined parameter D₀-D_(n) transmitted bythe flash memory 180 at the rate of the asynchronous mode after thecontroller 160 enables the flash memory 180 to switch to the synchronousmode. For example, the controller 160 reads four data sectors D₀, D₂, D₄and D₆ of the predetermined parameter transmitted with both the positiveedge and the negative edge of the write-enable clock signal WE# by theflash memory 180 according to the positive edge of the write-enableclock signal WE#, and take the four data sectors D₀, D₂, D₄ and D₆ asthe second reference parameter, but it is not limited thereto. It shouldbe noted that, in one embodiment of the present invention, the flashmemory 180 supports the synchronous mode, such that the first referenceparameter constituted by D₀, D₁, D₂ and D₃ and read by the controller160 in the asynchronous mode is different from the second referenceparameter constituted by D₀, D₂, D₄ and D₆ and read by the controller160 in the detection mode.

FIG. 7 is a signal diagram illustrating another embodiment of signals inthe detection mode of the present disclosure. In this embodiment, thesynchronous mode is the ONFI DDR mode, the clock signal is thewrite-enable clock signal WE#, the first predetermined trigger edge isthe negative edge of the write-enable clock signal WE#, the secondpredetermined trigger edge includes both the positive edge and thenegative edge of the write-enable clock signal WE#, and the flash memory180 supports the synchronous mode. In the detection mode, the controller160 enables the flash memory 180 to switch to the synchronous mode andtransmit the predetermined parameter D₀-D_(n) to the controller 160. Itshould be noted that, in this embodiment, the flash memory 180 supportsthe synchronous mode, such that the flash memory 180 can transmit thepredetermined parameter D₀-D_(n) according to both the positive edge andthe negative edge of the write-enable clock signal WE# to the controller160 through the data line DATA after the controller 160 enables theflash memory 180 to switch to the synchronous mode. Moreover, thecontroller 160 reads the predetermined parameter according to thenegative edge of the write-enable clock signal WE# to obtain a secondreference parameter. It should be noted that, in one embodiment of thepresent invention, the controller 160 is arranged to read at least twodata sectors of the predetermined parameter D₀-D_(n) transmitted withboth the positive edge and the negative edge of the write-enable clocksignal WE# by the flash memory 180 according to the negative edge of thewrite-enable clock signal WE# in the detection mode, and take the readat least two data sectors as the second reference parameter. Namely, inthe detection mode, the controller 160 reads the predetermined parameterD₀-D_(n) transmitted by the flash memory 180 at the rate of theasynchronous mode after the controller 160 enables the flash memory 180to switch to the synchronous mode. For example, the controller 160 mayread the data sectors D₁, D₃, D₅ and D₇ of the predetermined parametertransmitted with the negative edge and the positive edge of thewrite-enable clock signal WE# by the flash memory 180 according to thenegative edge of the write-enable clock signal WE#, and take the datasectors D₁, D₃, D₅ and D₇ of the predetermined parameter as the secondreference parameter, but it is not limited thereto. It should be notedthat, in one embodiment of the present invention, the flash memory 180supports the synchronous mode, such that the first reference parameterconstituted by D₀, D₁, D₂ and D₃ and read by the controller 160 in theasynchronous mode is different from the second reference parameterconstituted by D₁, D₃, D₅ and D₇ and read by the controller 160 in thedetection mode.

When the flash memory 180 does not support the synchronous mode, theflash memory 180 cannot transmit the predetermined parameter D₀-D_(n)according to both the positive edge and the negative edge of theread-enable clock signal RE# after the controller 160 enables the flashmemory 180 to switch to the synchronous mode. Namely although thecontroller 160 has enabled the flash memory 180 to switch in thesynchronous mode, the flash memory 180 can only transmit thepredetermined parameter D₀-D_(n) according to the positive edge of theread-enable clock signal RE# or the negative edge of the read-enableclock signal RE#. Therefore, the signal diagram produced by the datastorage device 100 is same as FIG. 2 or FIG. 3 when the flash memory 180does not support the synchronous mode. Namely, the first referenceparameter and the second reference parameter are the same. In oneembodiment of the present invention, the flash memory 180 does notsupport the synchronous mode, such that the first reference parameterconstituted by D₀, D₁, D₂ and D₃ and read by the controller 160 in theasynchronous mode is same as the second reference parameter constitutedby D₀, D₁, D₂ and D₃ and read by the controller 160 in the detectionmode. Therefore, the controller 160 can determine whether the flashmemory 180 supports the synchronous mode by comparing the firstreference parameter with the second reference parameter.

FIG. 8 is a signal diagram illustrating an embodiment of signals in asynchronous mode of the present disclosure. In this embodiment, thesynchronous mode is the ONFI Toggle mode, the clock signal is theread-enable clock signal RE#, the second predetermined trigger edgeincludes both the positive edge and the negative edge of the read-enableclock signal RE#, and the flash memory 180 supports the synchronousmode. When the data storage device 100 is in the synchronous mode, thecontroller 160 enables the flash memory 180 to transmit data through thedata line DATA according to both the positive edge and the negative edgeof the read-enable clock signal RE#. Moreover, the controller 160 readsthe data transmitted by the flash memory 180 according to both thepositive edge and the negative edge of the read-enable clock signal RE#.

FIG. 9 is a signal diagram illustrating another embodiment of signals inthe synchronous mode of the present disclosure. In this embodiment, thesynchronous mode is the ONFI DDR mode, the clock signal is thewrite-enable clock signal WE#, the second predetermined trigger edgeincludes both the positive edge and the negative edge of thewrite-enable clock signal WE#, and the flash memory 180 supports thesynchronous mode. When the data storage device 100 operates in thesynchronous mode, the controller 160 enables the flash memory 180 totransmit data through the data line DATA according to both the positiveedge and the negative edge of the write-enable clock signal WE#.Moreover, the controller 160 reads the data transmitted by the flashmemory 180 according to both the positive edge and the negative edge ofthe write-enable clock signal WE#.

FIG. 10 is a flowchart of a mode-detection method according to anotherembodiment of the present disclosure. The mode-detection method isapplied to the data storage device 100 of FIG. 1. The process starts atstep S1000.

In step S1000, the controller 160 is arranged to enable the flash memory180 to transmit the predetermined parameter to the controller 160according to a first predetermined trigger edge of a clock signal in theasynchronous mode. It should be noted that, in this embodiment, theflash memory 180 is arranged to store the predetermined parameter. Forexample, the predetermined parameter is able to be saved into the flashmemory while the flash memory is in production and arranged to determinethe type of the flash memory 180, but it is not limited thereto. Inanother embodiment, the first predetermined trigger edge is the positiveedge of the clock signal.

Next, in step S1002, the controller 160 is arranged to read thepredetermined parameter according to the first predetermined triggeredge of the clock signal to obtain a first reference parameter in theasynchronous mode. It should be noted that the controller 160 may readthe predetermined parameter according to a read command in theasynchronous mode and the detection mode. For example, the read commandmay be a READ Command or a READ PARAMETER Command. Moreover, in oneembodiment, the controller 160 is arranged to read at least two datasectors of the predetermined parameter transmitted with the firstpredetermined trigger edge of the clock signal by the flash memory 180according to the first predetermined trigger edge of the clock signal,and take the read at least one data sectors as the first referenceparameter. For example, the controller 160 reads four data sectors ofthe predetermined parameter transmitted with the first predeterminedtrigger edge of the clock signal by the flash memory 180 according tothe first predetermined trigger edge of the clock signal, and take theread four data sector as the first reference parameter. The details canbe referred to in FIG. 2 and FIG. 3.

In step S1004, in the detection mode, the controller 160 enables theflash memory to switch to the synchronous mode and transmit thepredetermined parameter to the controller 160. In one embodiment, thesynchronous mode is the ONFI Toggle mode. In another embodiment, thesynchronous mode is the ONFI DDR mode. It should be noted that, if theflash memory 180 supports the synchronous mode, the flash memory 180transmits the predetermined parameter to the controller 160 according toa second predetermined trigger edge of the clock signal after thecontroller 160 enables the flash memory 180 to switch to the synchronousmode, wherein the first predetermined trigger edge and the secondpredetermined trigger edge is different. If the flash memory 180 doesnot support the synchronous mode, the flash memory 180 transmits thepredetermined parameter to the controller 160 according to the firstpredetermined trigger edge of the clock signal after the controller 160enables the flash memory 180 to switch to the synchronous mode. When thesynchronous mode is the ONFI Toggle mode, the clock signal is theread-enable clock signal RE# arranged to be transmitted to the flashmemory 180 from the controller 160. When the synchronous mode is theONFI DDR mode, the clock signal is the write-enable clock signal WE#arranged to be transmitted to the flash memory 180 from the controller160, but it is not limited thereto. Moreover, the first predeterminedtrigger edge is the positive edge of the clock signal or the negativeedge of the clock signal, and the second predetermined trigger edgeincludes both the positive edge and the negative edge of the clocksignal.

In step S1006, in the detection mode, the controller 160 reads the firstpredetermined trigger edge transmitted by the flash memory 180 accordingto the first predetermined trigger edge of the clock signal to obtain asecond reference parameter. It should be noted that the controller 160may read the predetermined parameter according to a read command in theasynchronous mode and the detection mode. For example, the read commandmay be a READ Command or a READ PARAMETER Command. In one embodiment,the controller 160 is arranged to read at least to data sectors D0-Dn ofthe predetermined parameter transmitted by the flash memory 180according to the second predetermined trigger edge of the clock signal,and take the read data sectors as the second reference parameter. Forexample, the controller 160 may read four data sectors of thepredetermined parameter transmitted by the flash memory 180 according tothe second predetermined trigger edge of the clock signal, and take theread four data sectors as the second reference parameter. The detailsmay be referred to FIGS. 4-7, but it is not limited thereto.

In step S1008, the controller 160 is arranged to compare the firstreference parameter with the second reference parameter for determiningwhether the flash memory 180 supports the synchronous mode. When thefirst reference parameter and the second reference parameter are equal,the process goes to step S1012, otherwise, the process goes to stepS1010.

In step S1010, the controller 160 determines that the flash memory 180supports the synchronous mode. The process ends at step S1010. It shouldbe noted that, when the flash memory 180 supports the synchronous modeand the data storage device 100 operates in the synchronous mode, thecontroller 160 enables the flash memory 180 to transmit and write dataaccording to the frequency of the second predetermined trigger edge ofthe clock signal, and reads the data transmitted by the flash memory 180and write data into the flash memory 180 according to the secondpredetermined trigger edge of the clock signal. Moreover, the firstpredetermined trigger edge is the positive edge of the clock signal orthe negative edge of the clock signal, the second predetermined triggeredge includes both the positive edge and the negative edge of the clocksignal. The flash memory 180 is accessed by the frequency of thepositive edge or the negative edge of the clock signal in theasynchronous mode, and the flash memory 180 is accessed by the frequencyof both the positive edge and the negative edge of the clock signal. Thedetails may be referred to in FIGS. 8-9.

In step S1012, the controller 160 determines that the flash memory 180does not support the synchronous mode. The process ends at step S1012.In one embodiment, the controller 160 may produce a determination signalaccording to the result and provide the determination signal to a host(not shown), such that the host may perform the corresponding operationaccording to the determination signal. For example, the host may displaythe result on an output device according to the determination signal.The output device may be a display device, a speaker or a light, but itis not limited thereto.

The data storage device 100 and the mode-detection method of the presentinvention are capable of determining whether the data storage device 100supports the synchronous mode by comparing the predetermined parametersread in the asynchronous mode and the detection mode.

Data transmission methods, or certain aspects or portions thereof, maytake the form of program code (i.e., executable instructions) embodiedin tangible media, such as floppy diskettes, CD-ROMS, hard drives, orany other machine-readable storage medium, wherein, when the programcode is loaded into and executed by a machine such as a computer, themachine thereby becomes an apparatus for practicing the methods. Themethods may also be embodied in the form of program code transmittedover some transmission medium, such as electrical wiring or cabling,through fiber optics, or via any other form of transmission, wherein,when the program code is received and loaded into and executed by amachine such as a computer, the machine becomes an apparatus forpracticing the disclosed methods. When implemented on a general-purposeprocessor, the program code combines with the processor to provide aunique apparatus that operates analogously to application-specific logiccircuits.

While the invention has been described by way of example and in terms ofthe preferred embodiments, it is to be understood that the invention isnot limited to the disclosed embodiments. On the contrary, it isintended to cover various modifications and similar arrangements (aswould be apparent to those skilled in the art). Therefore, the scope ofthe appended claims should be accorded the broadest interpretation so asto encompass all such modifications and similar arrangements.

What is claimed is:
 1. A data storage device, capable of operating in an asynchronous mode comprising: a flash memory, arranged to store a predetermined parameter; and a controller, arranged to respectively read the predetermined parameter from the flash memory according to a first predetermined trigger edge of the clock signal in a first period and a second period to obtain a first reference parameter and a second reference parameter, and compare the first reference parameter and the second reference parameter to determine whether the flash memory supports a synchronous mode, wherein the data transmission rate of the synchronous mode is two times more than the data transmission rate of the asynchronous mode.
 2. The data storage device as claimed in claim 1, wherein in the first period, the data storage device operates in the asynchronous mode, and the controller enables the flash memory to transmit the predetermined parameter according the first predetermined trigger edge and reads the predetermined parameter transmitted by the flash memory according to the first predetermined trigger edge to obtain the first reference parameter in the asynchronous mode.
 3. The data storage device as claimed in claim 2, wherein in the second period, the controller enables the flash memory to switch to the synchronous mode and transmit the predetermined parameter, and reads the predetermined parameter transmitted by the flash memory according to the first predetermined trigger edge to obtain the second reference parameter.
 4. The data storage device as claimed in claim 3, wherein when the flash memory supports the synchronous mode, the flash memory transmits the predetermined parameter according a second predetermined trigger edge of the clock signal after the controller enables the flash memory to switch to the synchronous mode, wherein the first predetermined trigger edge is different from the second predetermined trigger edge.
 5. The data storage device as claimed in claim 3, wherein when the flash memory does not support the synchronous mode, the flash memory transmits the predetermined parameter according to the first predetermined trigger edge of the clock signal after the controller enables the flash memory to switch to the synchronous mode.
 6. The data storage device as claimed in claim 1, wherein the controller determines that the flash memory supports the synchronous mode when the first reference parameter and the second reference parameter are different, and the controller determines that the flash memory does not support the synchronous mode when the first reference parameter and the second reference parameter are equal.
 7. The data storage device as claimed in claim 4, wherein the first predetermined trigger edge is the positive edge or the negative edge of the clock signal, and the second predetermined trigger edge includes both the positive edge and the negative edge of the clock signal.
 8. The data storage device as claimed in claim 1, wherein the controller is configured to respectively read at least two data sectors of the predetermined parameter transmitted by the flash memory in the first period and the second period to serve as the first reference parameter and the second reference parameter.
 9. The data storage device as claimed in claim 1, wherein the clock signal is a read-enable clock signal transmitted to the flash memory from the controller, and the synchronous mode is ONFI Toggle mode.
 10. The data storage device as claimed in claim 1, wherein the clock signal is a write-enable clock signal transmitted to the flash memory from the controller, and the synchronous mode is ONFI DDR mode.
 11. A mode-detection method, applied to a data storage device capable of operating in an asynchronous mode, comprising: reading a predetermined parameter transmitted by a flash memory of the data storage device according to a first predetermined trigger edge of a clock signal in a first period and a second period to obtain a first reference parameter and a second reference parameter; and comparing the first reference parameter and the second reference parameter to determine whether the flash memory supports a synchronous mode, wherein the data transmission rate of the synchronous mode is two times more than the data transmission rate of the asynchronous mode.
 12. The mode-detection method as claimed in claim 11, wherein in the first period, the data storage device operates in the asynchronous mode and the mode-detection method further comprises: enabling the flash memory to transmit the predetermined parameter according the first predetermined trigger edge; and reading the predetermined parameter transmitted by the flash memory according to the first predetermined trigger edge to serve as the first reference parameter.
 13. The mode-detection method as claimed in claim 12, wherein in the second period, the mode-detection method further comprises: enabling the flash memory to switch to the synchronous mode and transmit the predetermined parameter; and reading the predetermined parameter transmitted by the flash memory according to the first predetermined trigger edge to serve as the second reference parameter.
 14. The mode-detection method as claimed in claim 13, wherein when the flash memory supports the synchronous mode, the flash memory transmits the predetermined parameter according a second predetermined trigger edge of the clock signal after enabling the flash memory to switch to the synchronous mode, wherein the first predetermined trigger edge is different from the second predetermined trigger edge.
 15. The mode-detection method as claimed in claim 13, wherein when the flash memory does not support the synchronous mode, the flash memory transmits the predetermined parameter according to the first predetermined trigger edge of the clock signal after enabling the flash memory to switch to the synchronous mode.
 16. The mode-detection method as claimed in claim 11, further comprising: determining that the flash memory supports the synchronous mode when the first reference parameter and the second reference parameter are different; and determining that the flash memory does not support the synchronous mode when the first reference parameter and the second reference parameter are equal.
 17. The mode-detection method as claimed in claim 14, wherein the first predetermined trigger edge is the positive edge or the negative edge of the clock signal, and the second predetermined trigger edge includes both the positive edge and the negative edge of the clock signal.
 18. The mode-detection method as claimed in claim 11, wherein the step of respectively reading the predetermined parameter transmitted by the flash memory in the first period and the second period to obtain the first reference parameter and the step is arranged to respectively read at least two data sectors of the predetermined parameter transmitted by the flash memory in the first period and the second period to serve as the first reference parameter and the second reference parameter.
 19. The mode-detection method as claimed in claim 11, wherein the clock signal is a read-enable clock signal transmitted to the flash memory from a controller of the data storage device, and the synchronous mode is ONFI Toggle mode.
 20. The mode-detection method as claimed in claim 11, wherein the clock signal is a write-enable clock signal transmitted to the flash memory from a controller of the data storage device, and the synchronous mode is ONFI DDR mode. 